package com.ruoyi.teaching.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import java.util.List;
import com.ruoyi.teaching.domain.YaCourseDesignDetail;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Param;

/**
 * 课程设计详情Mapper接口
 *
 * @author ruoyi
 * @date 2025-03-15
 */
public interface YaCourseDesignDetailMapper  extends BaseMapper<YaCourseDesignDetail>
{
    /**
     * 查询课程设计详情
     *
     * @param id 课程设计详情主键
     * @return 课程设计详情
     */
    public YaCourseDesignDetail selectYaCourseDesignDetailById(Long id);

    /**
     * 查询课程设计详情列表
     *
     * @param yaCourseDesignDetail 课程设计详情
     * @return 课程设计详情集合
     */
    public List<YaCourseDesignDetail> selectYaCourseDesignDetailList(YaCourseDesignDetail yaCourseDesignDetail);

    /**
     * 新增课程设计详情
     *
     * @param yaCourseDesignDetail 课程设计详情
     * @return 结果
     */
    public int insertYaCourseDesignDetail(YaCourseDesignDetail yaCourseDesignDetail);

    /**
     * 修改课程设计详情
     *
     * @param yaCourseDesignDetail 课程设计详情
     * @return 结果
     */
    public int updateYaCourseDesignDetail(YaCourseDesignDetail yaCourseDesignDetail);

    /**
     * 删除课程设计详情
     *
     * @param id 课程设计详情主键
     * @return 结果
     */
    public int deleteYaCourseDesignDetailById(Long id);

    /**
     * 批量删除课程设计详情
     *
     * @param ids 需要删除的数据主键集合
     * @return 结果
     */
    public int deleteYaCourseDesignDetailByIds(Long[] ids);

    void deleteYaCourseDesignDetailByNotInId(@Param("courseId") Long courseId, @Param("stage")Integer stage, @Param("idList")List<Long> idList);

    @Delete("delete from ya_course_design_interview where cd_id = #{cdId}")
    void deleteRelatedInterview(@Param("cdId")Integer cdId);

    @Insert("insert into ya_course_design_interview(cd_id,interview_id) values(#{cdId},#{interviewId}) ")
    void insertCourseDesignInterview(@Param("cdId")Integer cdId, @Param("interviewId")Integer interviewId);

}
